#include "widget.h"
#include "ui_widget.h"
#include<QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    //Qt中同一个控件不能同时添加到多个布局管理器
    QPushButton*button1=new QPushButton("按钮1");
    QPushButton*button2=new QPushButton("按钮2");
    QPushButton*button3=new QPushButton("按钮3");
    QPushButton*button4=new QPushButton("按钮4");
    QPushButton*button5=new QPushButton("按钮5");
    QPushButton*button6=new QPushButton("按钮6");
    ui->verticalLayout->addWidget(button1);
    ui->verticalLayout->addWidget(button2);
    ui->verticalLayout->addWidget(button3);

    ui->verticalLayout_2->addWidget(button4);
    ui->verticalLayout_2->addWidget(button5);
    ui->verticalLayout_2->addWidget(button6);
    ui->verticalLayout_2->setSpacing(50);
    ui->verticalLayout_2->setContentsMargins(40,30,20,4);

}

Widget::~Widget()
{
    delete ui;
}

